﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Script.Serialization;

namespace Eis51.Web.common
{
    /// <summary>
    /// 公共类
    /// </summary>
    public class common
    {
        /// <summary>
        /// 反射实体变成对应的json格式
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        public static string JavaScriptSerializerString(object p)
        {
            JavaScriptSerializer json = new JavaScriptSerializer();
            // 序列化对象为JSON字符串
            return json.Serialize(p);

        }

        /// <summary>
        /// 首页图片类型
        /// </summary>
        public enum FirstImg
        {
            /// <summary>
            /// 首页上面的图片=1
            /// </summary>
            Up = 1,
            /// <summary>
            /// 首页中间的图片=2
            /// </summary>
            Mid = 2
        }

    }
}
